package com.yxdj.service.api;

import com.yxdj.common.core.constant.SecurityConstants;
import com.yxdj.common.core.constant.ServiceNameConstants;
import com.yxdj.common.core.domain.R;
import com.yxdj.service.api.domain.SubCategory;
import com.yxdj.service.api.factory.RemoteSubCategoryFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author 韩总
 */
@FeignClient(contextId = "remoteSubCategoryService",value = ServiceNameConstants.SERVICE_SERVICE,fallbackFactory = RemoteSubCategoryFallbackFactory.class)
public interface RemoteSubCategoryService {
    /**
     * 查询前几个子分类的方法
     * @param limit
     * @param source
     * @return
     */
    @GetMapping("/sub/app/getSubCategoryList/{limit}")
    R<List<SubCategory>> getSubCategoryList(@PathVariable(name = "limit") Integer limit, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
